// 导入axios实例
import httpRequest from '@/request/index'

// 定义接口的传参
export interface PointInfoParam {
    name: string,
    posX: number,
    posY: number,
    posZ: number,
    inspecType?: number, // 图标类型
    inspecStatus: number,
}


// 提交信息信息
export function addPoint(data: PointInfoParam) {
    return httpRequest({
        url: '/app/lyInspection',
        method: 'POST',
        data,
    })
}
// 获取巡检点
export function getPointList(pointType:number) {
    return httpRequest({
        url: '/app/lyInspection/list-all',
        method: 'GET',
        params:{
            pointType
        }
    })
}

// 删除巡检点
export function delPointByIds(id: Number | String) {
    return httpRequest({
        url: `/app/lyInspection/deleteOne/${id}`,
        method: 'DELETE',
    })
}

export interface PathInfoParam {
    inspectionPath: string,
    name: string
}


// 保存巡检路线
export function saveCheckLine(data:pointParam) {
    return httpRequest({
        url: '/app/lyPath',
        method: 'POST',
        data,
    })
}


export interface pointParam {
    x: number,
    y: number,
    z: number
}
// 查询巡检路线经过的巡检点
export function postPointsForCheck(points: pointParam[]) {
    return httpRequest({
        url: '/app/lyInspection/through',
        method: 'POST',
        data: {
            points
        }
    })
}

// 保存3D对象
export function saveThreeObj(data: any) {
    return httpRequest({
        url: '/common/blueprint',
        method: 'POST',
        data
    })
}


// 获取巡检路线
export function getCheckLineList() {
    return httpRequest({
        url: '/app/lyPath/list-all',
        method: 'GET',
    })
}

// 删除巡检路线
export function delCheckLineById(id:Number|String) {
    return httpRequest({
        url: `/app/lyPath/${id}`,
        method: 'DELETE',
    })
}

// 获取回放路线
export function getTempReplay() {
    return httpRequest({
        url: '/app/lyPath/replay/1',
        method: 'GET',
    })
}